﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Data.MyDbContext;

namespace WebIndex.Controllers
{
    public class HomeController : Controller
    {
        private WebStudioDbContext db = new WebStudioDbContext();


        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";


            string name = Request.LogonUserIdentity.Name;
            return View(db.Categories.ToList());
        }

        public ActionResult Main()
        {
            ViewBag.Message = "This is main page.";

            return View(db.Categories.ToList());
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
    }
}
